package com.ssy.lingxi.pay.entity.allInPay;

import lombok.Data;

import javax.persistence.*;

/**
 * 通联支付用户信息主表
 *
 * @author lqa
 * @version 2.0.0
 * @date 2021/11/26
 */
@Data
@Entity
@Table(schema = "public", name = "pay_all_in_pay", uniqueConstraints = @UniqueConstraint(columnNames = {"memberId", "memberRoleId"}), indexes = {@Index(name = "pay_all_in_pay_biz_user_id_idx", columnList = "bizUserId"),
        @Index(name = "pay_all_in_pay_user_id_idx", columnList = "userId")})
public class AllInPay {
    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "account_cash_out_record_seq")
    @SequenceGenerator(sequenceName = "pay_all_in_pay", name = "all_in_pay", allocationSize = 1)
    private Long id;

    /**
     * 会员id
     */
    @Column(columnDefinition = "int8")
    private Long memberId;

    /**
     * 会员名称
     */
    @Column(columnDefinition = "varchar(32)")
    private String memberName;

    /**
     * 会员角色id
     */
    @Column(columnDefinition = "int8")
    private Long memberRoleId;

    /**
     * 会员角色名称
     */
    @Column(columnDefinition = "varchar(32)")
    private String memberRoleName;

    /**
     * 会员类型MemberTypeEnum定义
     */
    @Column(columnDefinition = "int")
    private Integer memberType;

    /**
     * 通联会员类型 2-企业会员 3-个人会员
     */
    @Column(columnDefinition = "int")
    private Integer allInMemberType;

    /**
     * 会员等级类型: 1-平台会员; 2-商户会员; 3-渠道会员
     */
    @Column(columnDefinition = "int")
    private Integer memberLevelType;

    /**
     * 商户系统用户标识,商户系统中唯一编号
     */
    @Column(columnDefinition = "varchar(32)")
    private String bizUserId;

    /**
     * 云商通用户唯一标识
     */
    @Column(columnDefinition = "varchar(64)")
    private String userId;

    /**
     * 用户所属平台
     */
    @Column(columnDefinition = "varchar(20)")
    private String sysId;

    /**
     * 通联用户名称
     */
    @Column(columnDefinition = "varchar(32)")
    private String name;

    /**
     * 证件类型(目前只支持身份证) 1-身份证 2-护照 3-军官证。。。
     */
    @Column(columnDefinition = "int")
    private Integer cardType;

    /**
     * 证件号码
     */
    @Column(columnDefinition = "varchar(32)")
    private String cardNo;

    /**
     * 手机号码
     */
    @Column(columnDefinition = "varchar(11)")
    private String phone;

    /**
     * 是否实名验证 0-未验证 1-已验证
     * 个人会员需要用到
     */
    @Column(columnDefinition = "int default 0")
    private Integer isAuth;

    /**
     * 是否进行电子签约 0-未签约 1-已签约
     */
    @Column(columnDefinition = "int default 0")
    private Integer isSign;

    /**
     * 会员状态: 1-正常, 2-已冻结
     */
    @Column(columnDefinition = "int default 1")
    private Integer memberStatus;

    /**
     * 个人账户状态: 1-有效 3-审核失败 5-已锁 7-待审核 (AllInPayPersonalStateEnum)
     * 企业账户状态: 1-待审核 2-审核成功 3-审核失败(AllInPayEnterpriseStateEnum)
     */
    @Column(columnDefinition = "int")
    private Integer accountStatus;

    /**
     * 用户是否提交信息 1-已提交 2-未提交
     */
    @Column(columnDefinition = "int default 2")
    private Integer isSubmit=2;

    /**
     * 余额(冗余字段) 单位：分
     */
    @Column(columnDefinition = "int8")
    private Integer amount;

    /**
     * 会员电子协议编号
     */
    @Column(columnDefinition = "varchar(32)")
    private String contractNo;
    /**
     * 是否绑定手机 1-已绑定 2-未绑定
     */
    @Column(columnDefinition = "int default 2")
    private Integer isPhoneChecked=2;

    /**
     * 创建时间
     */
    @Column(columnDefinition = "int8")
    private Long createTime = System.currentTimeMillis();

    /**
     * 修改时间
     */
    @Column(columnDefinition = "int8")
    private Long updateTime = System.currentTimeMillis();

}
